<template>
<div>
  <home :get-msg="faMsg" @myevent="getChildMsg"></home>
  <other ref="otherChild"></other>
  <button @click="getOtherChild"></button>
</div>
</template>

<script>
import Vue from 'vue'
// 引入组件
import Home from "./views/Home"
import Other from "./views/Other"
//注册组件
Vue.component("home",Home)
Vue.component("other",Other)
    export default{
        // components:{
        //   "home": Home,
        //   "other":Other
        // }
        data(){
            return {
              faMsg:"father"
            }
        },
        methods:{
          getChildMsg(val){
            console.log(val);
          },
          getOtherChild(){
            this.refs.otherChild
          }
        }
    }
</script>

<style lang="scss">
</style>
